 <!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    

    <title>{$Think.config.site.title} - 商品管理</title>

    <meta name="keywords" content="{$Think.config.site.keywords}">

    <link href="{$Think.config.site.resource_url}css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/animate.min.css" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/style.min.css?v=4.0.0" rel="stylesheet">

</head>
<style>
#listtable .fa{
	cursor:pointer;
	color:#1ab394;
	margin-right:1em;
}
th .tag{font-size: 12px; color: #e66c6c; font-weight: normal;}
.ibox-title .tag{font-size: 12px; color: #e66c6c; font-weight: normal; display: inline-block; margin-left: 20px;}
.specval-hide{display: none;}
</style>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight" style="height: 100%; overflow: hidden;">
      <div class="row" style="height: 100%; overflow: hidden;">
      		<div class="col-sm-6"  style="height: 100%; overflow: hidden;">
      			<div class="ibox float-e-margins"  style="height: 100%; overflow: hidden;">
                    <div class="ibox-title">
                        <h5>已选商品</h5>
                    </div>
                    <div class="ibox-content" style="height: 100%; overflow: auto;">
                    	<div class="table-responsive">
					        <table class="table table-striped" id="listtable">
					            <thead>
					                <tr>
					                    <th width="">商品图片</th>
					                    <th width="">商品名称</th>
					                    <th width="">价格</th>
					                    <th width="">销量</th>
					                    <th width="">操作</th>
					                </tr>
					            </thead>
					            <tbody>
					            	{volist name="list" id="vo"}
					                <tr data-id="{$vo.goods_id}" class="tr_goods" id="goods_{$vo.goods_id}">
					                    <td><img src="{$vo.picture}" width="30" height="30"></td>
					                    <td class="goodsname">{$vo.goods_name}</td>
					                    <td class="price">{$vo.min_price}-{$vo.max_price}</td>
					                    <td class="sales">{$vo.sales}</td>
					                    <td><button type="button" class="btn btn-primary btn-xs delleft">&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;</button></td>
					                </tr>
					               {/volist}
					            </tbody>
					        </table>
					    </div>
                    </div>
                </div>
      		</div>
          	<div class="col-sm-6"  style="height: 100%; overflow: hidden;">
                <div class="ibox float-e-margins"  style="height: 100%; overflow: hidden;">
                    <div class="ibox-title">
                        <h5>商品列表</h5>
                    </div>
                    <div class="ibox-content"  style="height: 100%; overflow: hidden; padding: 0;">
                    	<iframe src="{:url('goodsList')}" style="width: 100%; height: 95%; border:none; padding: 0;margin: 0; overflow-x: hidden;"></iframe>
                    </div>
                </div>
            </div>

        </div>
    </div>

    <script src="{$Think.config.site.resource_url}js/jquery.min.js?v=2.1.4"></script>
    <script src="{$Think.config.site.resource_url}js/bootstrap.min.js?v=3.3.5"></script>
    <script src="{$Think.config.site.resource_url}js/plugins/peity/jquery.peity.min.js"></script>
    <script src="{$Think.config.site.resource_url}js/plugins/iCheck/icheck.min.js"></script>
    <script src="{$Think.config.site.resource_url}js/plugins/layer/layer.js"></script>
    <script src="{$Think.config.site.common_resource_url}js/majax.js"></script>
</body>

</html>
<script>
function addGoods(re){
	var isset = $('#listtable tbody').find('tr[id="goods_'+re.id+'"]');
	if (isset.size()>0) {return false;}
	var str='<tr data-id="'+re.id+'" id="goods_'+re.id+'" class="tr_goods">\
                <td><img src="'+re.img+'" width="30" height="30"></td>\
                <td class="goodsname">'+re.name+'</td>\
                <td class="price">'+re.price+'</td>\
                <td class="sales">'+re.sales+'</td>\
                <td><button type="button" class="btn btn-primary btn-xs delleft">&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;</button></td>\
            </tr>';
    $('#listtable tbody').append(str);
}

$('tbody').delegate('.delleft','click',function(){
	$(this).closest('tr').remove();
})
</script>